package com.zhq.zhq_blog.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhq.zhq_blog.entity.Blog;
import com.zhq.zhq_blog.entity.RankingList;
import com.zhq.zhq_blog.mapper.RankingListMapper;
import com.zhq.zhq_blog.service.IRankingListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * <p>
 *  排行榜服务实现类
 * </p>
 */
@Service
public class RankingServiceListImpl extends ServiceImpl<RankingListMapper, RankingList> implements IRankingListService {

    RankingListMapper rankingListMapper;

    public RankingServiceListImpl(RankingListMapper rankingListMapper){
        this.rankingListMapper = rankingListMapper;
    }

    @Override
    public IPage<RankingList> queryRankingListPage(Page<RankingList> page, QueryWrapper<RankingList> queryWrapper) {
        return rankingListMapper.queryRankingListPage(page,queryWrapper);
    }

    @Override
    public RankingList queryRankingListByBlogId(int blogId) {
        return rankingListMapper.queryRankingListByBlogId(blogId);
    }

    @Override
    public int removeByBlogId(int blogId) {
        int remove = rankingListMapper.removeByBlogId(blogId);
        return remove;
    }

    @Override
    public int updateByBlogId(int blogId,int flow) {
        int update = rankingListMapper.updateByBlogId(blogId,flow);
        return update;
    }

}
